package cn.org.alexander.execption;

import cn.org.alexander.entity.response.ResponseResult;
import cn.org.alexander.entity.response.ResultCode;

/**
 * @author Alexander
 * @date 2022/5/21
 * @desc 自定义异常处理
 */
public class CustomException extends RuntimeException{

    private ResponseResult responseResult=null;
    private ResultCode resultCode=null;

    public CustomException(ResponseResult responseResult) {
        super(responseResult.getMsg());
        this.responseResult = responseResult;
    }

    public CustomException(ResultCode resultCode) {
        super(resultCode.msg());
        this.resultCode = resultCode;
    }

    public ResponseResult getResponseResult() {
        return responseResult;
    }

    public ResultCode getResultCode() {
        return resultCode;
    }
}
